Skip to content

Conversation

@koic
Copy link
Contributor

@koic koic commented Sep 12, 2025

In the LLM field, the name LangChain is widely recognized, and the project was likely originally intended to be called LangChain.rb as a product: ab9d988

It appears that the current use of the name Langchain is due to implementation constraints. This PR updates the behavior so that Zeitwerk also recognizes the LangChain module name for the langchain.rb file.

Both the existing Langchain and the new LangChain module names will work. However, the Langchain constant is now marked as deprecated, and a warning will be shown when it is used:

$ bundle exec ruby -Ilib -rrails -rlangchainrb -e 'Langchain::Errors'
-e:1: warning: `LangChain` is deprecated. Use `LangChain` instead.

This change makes it possible to use the name LangChain, which is the standard name in the AI ecosystem. Because LangChain is a proper noun, renaming to this widely recognized and commonly used name follows the principle of least surprise for users.

@koic koic force-pushed the rename_langchain branch 3 times, most recently from e6c1f0b to 3f3d45e Compare September 12, 2025 17:33
In the LLM field, the name LangChain is widely recognized, and the project was
likely originally intended to be called LangChain.rb as a product:
patterns-ai-core@ab9d988

It appears that the current use of the name `Langchain` is due to implementation constraints.
This PR updates the behavior so that Zeitwerk also recognizes the `LangChain` module name for the `langchain.rb` file.

Both the existing `Langchain` and the new `LangChain` module names will work.
However, the `Langchain` constant is now marked as deprecated, and a warning will be shown when it is used:

```console
$ bundle exec ruby -Ilib -rrails -rlangchainrb -e 'Langchain::Errors'
-e:1: warning: `LangChain` is deprecated. Use `LangChain` instead.
```

This change makes it possible to use the name `LangChain`, which is the standard name in the AI ecosystem.
Because `LangChain` is a proper noun, renaming to this widely recognized and commonly used name follows
the principle of least surprise for users.
@sandstrom
Copy link

sandstrom commented Sep 19, 2025

Out of curiosity, what's the relationship between this gem/repo and the original langchain project?

Because that project is now driven by a for-profit startup, and this seems more like a true open-source project that isn't bound to a specified company.

But also, if this is independent, maybe there is also some risk of confusion?


Even more unrelated, is there any discussion of collaboration between this project and RubyLLM?

One thing that seems like a good candidate for collaboration between these two projects are the model-provider wrappers and/or model registry.

So basically providing a unified API that hides the small differences between different providers. Maybe there are other 'building block' parts too, that would make sense to share?

Of course each project would still be independent and have different ideas about public APIs, gem design and purpose/aim of each project.

cc @crmne

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants